// Copyright 2010 Google Inc. All Rights Reserved.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.

package com.google.api.adwords.lib;

import com.google.api.adwords.lib.AdWordsVersion.AdWordsVersionV200909;
import com.google.api.adwords.lib.AdWordsVersion.AdWordsVersionV201003;
import com.google.api.adwords.lib.AdWordsVersion.AdWordsVersionV201008;
import com.google.api.adwords.lib.AdWordsVersion.AdWordsVersionV201101;
import com.google.api.adwords.v201101.o.BulkOpportunityService;

import org.apache.axis.client.Service;

import java.rmi.Remote;

/**
 * {@code AdWordsService} provides a class which defines a service that
 * can be instantiated through reflection. The properties of this object
 * are that it has a service name, an optional interface name prefix,
 * and a version. The interface name prefix will be used to locate an
 * interface in the form:
 * {@code <version.packagePrefix>.<interfacePrefix>Interface.java}
 *
 * @author api.arogal@gmail.com (Adam Rogal)
 */
public class AdWordsService {
  private final String serviceInterfaceNamePrefix;
  private final String serviceName;
  private final String serviceGroup;
  private final String serviceGroupUrl;
  private final AdWordsVersion version;

  /**
   * Using this constructor, the interface name prefix will be set to the
   * service name.
   *
   * @param serviceName the service name
   * @param version the version of the service
   */
  public AdWordsService(String serviceName, AdWordsVersion version) {
    this(serviceName, serviceName, version);
  }

  /**
   * @param serviceName the service name
   * @param serviceInterfaceName the name of the interface for the service
   * @param version the version of the service
   */
  public AdWordsService(String serviceName, String serviceInterfaceName, AdWordsVersion version) {
    this(serviceName, serviceInterfaceName, version, null, null);
  }

  /**
   * @param serviceName the service name
   * @param serviceInterfaceName the name of the interface for the service
   * @param version the version of the service
   * @param serviceGroup the service group
   */
  public AdWordsService(String serviceName, String serviceInterfaceName, AdWordsVersion version,
      String serviceGroup) {
    this(serviceName, serviceInterfaceName, version, serviceGroup, serviceGroup);
  }

  /**
   * @param serviceName the service name
   * @param version the version of the service
   * @param serviceGroup the service group
   */
  public AdWordsService(String serviceName, AdWordsVersion version,
      String serviceGroup) {
    this(serviceName, serviceName, version, serviceGroup, serviceGroup);
  }

  /**
   * @param serviceName the service name
   * @param version the version of the service
   * @param serviceGroup the service group
   * @param serviceGroupUrl the service group used in the endpoint URL
   */
  public AdWordsService(String serviceName, AdWordsVersion version,
      String serviceGroup, String serviceGroupUrl) {
    this(serviceName, serviceName, version, serviceGroup, serviceGroupUrl);
  }

  /**
   * @param serviceName the service name
   * @param serviceInterfaceName the name of the interface for the service
   * @param version the version of the service
   * @param serviceGroup the service group. {@code null} if no group exists for
   *     this service
   * @param serviceGroupUrl the service group used in the endpoint URL
   */
  public AdWordsService(String serviceName, String serviceInterfaceName, AdWordsVersion version,
      String serviceGroup, String serviceGroupUrl) {
    this.serviceName = serviceName;
    this.serviceInterfaceNamePrefix = serviceInterfaceName;
    this.version = version;
    this.serviceGroup = serviceGroup;
    this.serviceGroupUrl = serviceGroupUrl;
  }

  /**
   * Gets the service interface name prefix.
   *
   * @return the service interface name prefix
   */
  public String getServiceInterfaceNamePrefix() {
    return serviceInterfaceNamePrefix;
  }

  /**
   * Gets the service name.
   *
   * @return the service name
   */
  public String getServiceName() {
    return serviceName;
  }

  /**
   * Gets the version for this service.
   *
   * @return the version
   */
  public AdWordsVersion getVersion() {
    return version;
  }

  /**
   * Gets the service group. Can be {@code null} if the version has no groups.
   *
   * @return the service group
   */
  public String getServiceGroup() {
    return serviceGroup;
  }

  /**
   * Generates the interface class for this service by using reflection.
   *
   * @return the {@code Class<? extends Remote>} representing the interface
   * @throws ClassNotFoundException if the formulated interface name could not
   *     be found
   */
  public Class<? extends Remote> getInterfaceClass()
      throws ClassNotFoundException {
    return (Class<? extends Remote>) Class.forName(version.getPackagePrefix()
        + version + "." + (serviceGroup != null ? serviceGroup + "." : "")
        + serviceInterfaceNamePrefix + "Interface");
  }

  /**
   * Generates the locator class for this service by using reflection.
   *
   * @return the {@code Class<? extends Service>} representing the locator
   * @throws ClassNotFoundException if the formulated locator class name name
   *     could not be found
   */
  public Class<? extends Service> getLocatorClass()
      throws ClassNotFoundException {
    return (Class<? extends Service>) Class.forName(version.getPackagePrefix()
        + version + "." + (serviceGroup != null ? serviceGroup + "." : "")
        + serviceName + "Locator");
  }

  /**
   * Gets the endpoint server for the production or sandbox environment.
   *
   * @param useSandbox {@code true} if the endpoint address should be generated
   *     to make requests against the sandbox environment
   * @return the endpoint server of this service for the sandbox or production
   *     environment
   */
  public String getEndpointServer(boolean useSandbox) {
    return ((useSandbox) ? version.getSandboxUrl() : version.getProductionUrl());
  }

  /**
   * Gets the endpoint address for the endpoint server.
   *
   * @param endpointServer the server the endpoint address should be generated
   *     from
   * @return the endpoint address of this service
   */
  public String getEndpointAddress(String endpointServer) {
    return endpointServer + "/" + "api/adwords/"
        + (serviceGroupUrl != null ? serviceGroupUrl + "/" : "")
        + version + "/" + serviceName;
  }

  /**
   * The service class for v13. Each {@code AdWordsService} variable indicates
   * which interface should be used.
   */
  public abstract static class V13  {
    /**
     * Uses the interface {@link com.google.api.adwords.v13.AccountInterface}.
     */
    public static final AdWordsService ACCOUNT_SERVICE =
        new AdWordsService("AccountService", "Account", AdWordsVersion.V13);

    /**
     * Uses the interface {@link com.google.api.adwords.v13.ReportInterface}.
     */
    public static final AdWordsService REPORT_SERVICE =
        new AdWordsService("ReportService", "Report", AdWordsVersion.V13);

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v13.TrafficEstimatorInterface}.
     */
    public static final AdWordsService TRAFFIC_ESTIMATOR_SERVICE =
        new AdWordsService("TrafficEstimatorService", "TrafficEstimator", AdWordsVersion.V13);
  }

  /**
   * The service class for v200909. Each {@code AdWordsService} variable
   * indicates which interface should be used.
   */
  public abstract static class V200909 {
    /**
     * Uses the interface
     * {@link com.google.api.adwords.v200909.cm.AdGroupServiceInterface}.
     */
    public static final AdWordsService ADGROUP_SERVICE =
        new AdWordsService("AdGroupService", new AdWordsVersionV200909("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v200909.cm.CampaignAdExtensionServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_AD_EXTENSION_SERVICE =
        new AdWordsService("CampaignAdExtensionService", new AdWordsVersionV200909("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v200909.cm.AdExtensionOverrideServiceInterface}.
     */
    public static final AdWordsService AD_EXTENSION_OVERRIDE_SERVICE =
        new AdWordsService("AdExtensionOverrideService", new AdWordsVersionV200909("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v200909.cm.CampaignTargetServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_TARGET_SERVICE =
        new AdWordsService("CampaignTargetService", new AdWordsVersionV200909("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v200909.cm.CampaignServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_SERVICE =
        new AdWordsService("CampaignService", new AdWordsVersionV200909("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v200909.cm.AdGroupCriterionServiceInterface}.
     */
    public static final AdWordsService ADGROUP_CRITERION_SERVICE =
        new AdWordsService("AdGroupCriterionService", new AdWordsVersionV200909("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v200909.cm.CampaignCriterionServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_CRITERION_SERVICE =
        new AdWordsService("CampaignCriterionService", new AdWordsVersionV200909("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v200909.cm.GeoLocationServiceInterface}.
     */
    public static final AdWordsService GEO_LOCATION_SERVICE =
        new AdWordsService("GeoLocationService", new AdWordsVersionV200909("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v200909.cm.AdGroupAdServiceInterface}.
     */
    public static final AdWordsService ADGROUP_AD_SERVICE =
        new AdWordsService("AdGroupAdService", new AdWordsVersionV200909("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v200909.cm.AdParamServiceInterface}.
     */
    public static final AdWordsService AD_PARAM_SERVICE =
        new AdWordsService("AdParamService", new AdWordsVersionV200909("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v200909.info.InfoServiceInterface}.
     */
    public static final AdWordsService INFO_SERVICE =
        new AdWordsService("InfoService", new AdWordsVersionV200909("info"), "info");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v200909.cm.BulkMutateJobServiceInterface}.
     */
    public static final AdWordsService BULK_MUTATE_JOB_SERVICE =
        new AdWordsService("BulkMutateJobService", new AdWordsVersionV200909("cm"), "cm", "job");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v200909.o.TargetingIdeaServiceInterface}.
     */
    public static final AdWordsService TARGETING_IDEA_SERVICE =
        new AdWordsService("TargetingIdeaService", new AdWordsVersionV200909("o"), "o");
  }

  /**
   * The service class for v201003. Each {@code AdWordsService} variable
   * indicates which interface should be used.
   */
  public abstract static class V201003 {
    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.cm.AdGroupServiceInterface}.
     */
    public static final AdWordsService ADGROUP_SERVICE =
        new AdWordsService("AdGroupService", new AdWordsVersionV201003("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.cm.CampaignAdExtensionServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_AD_EXTENSION_SERVICE =
        new AdWordsService("CampaignAdExtensionService", new AdWordsVersionV201003("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.cm.AdExtensionOverrideServiceInterface}.
     */
    public static final AdWordsService AD_EXTENSION_OVERRIDE_SERVICE =
        new AdWordsService("AdExtensionOverrideService", new AdWordsVersionV201003("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.cm.CampaignTargetServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_TARGET_SERVICE =
        new AdWordsService("CampaignTargetService", new AdWordsVersionV201003("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.cm.CampaignServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_SERVICE =
        new AdWordsService("CampaignService", new AdWordsVersionV201003("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.cm.AdGroupCriterionServiceInterface}.
     */
    public static final AdWordsService ADGROUP_CRITERION_SERVICE =
        new AdWordsService("AdGroupCriterionService", new AdWordsVersionV201003("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.cm.CampaignCriterionServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_CRITERION_SERVICE =
        new AdWordsService("CampaignCriterionService", new AdWordsVersionV201003("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.cm.GeoLocationServiceInterface}.
     */
    public static final AdWordsService GEO_LOCATION_SERVICE =
        new AdWordsService("GeoLocationService", new AdWordsVersionV201003("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.cm.AdGroupAdServiceInterface}.
     */
    public static final AdWordsService ADGROUP_AD_SERVICE =
        new AdWordsService("AdGroupAdService", new AdWordsVersionV201003("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.cm.AdParamServiceInterface}.
     */
    public static final AdWordsService AD_PARAM_SERVICE =
        new AdWordsService("AdParamService", new AdWordsVersionV201003("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.cm.ReportDefinitionService}.
     */
    public static final AdWordsService REPORT_DEFINITION_SERVICE =
        new AdWordsService("ReportDefinitionService", new AdWordsVersionV201003("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.cm.MediaService}.
     */
    public static final AdWordsService MEDIA_SERVICE =
        new AdWordsService("MediaService", new AdWordsVersionV201003("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.cm.BidLandscapeService}.
     */
    public static final AdWordsService BID_LANDSCAPE_SERVICE =
        new AdWordsService("BidLandscapeService", new AdWordsVersionV201003("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.info.InfoServiceInterface}.
     */
    public static final AdWordsService INFO_SERVICE =
        new AdWordsService("InfoService", new AdWordsVersionV201003("info"), "info");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.cm.BulkMutateJobServiceInterface}.
     */
    public static final AdWordsService BULK_MUTATE_JOB_SERVICE =
        new AdWordsService("BulkMutateJobService", new AdWordsVersionV201003("cm"), "cm", "job");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201003.o.TargetingIdeaServiceInterface}.
     */
    public static final AdWordsService TARGETING_IDEA_SERVICE =
        new AdWordsService("TargetingIdeaService", new AdWordsVersionV201003("o"), "o");
  }

  /**
   * The service class for v201008. Each {@code AdWordsService} variable
   * indicates which interface should be used.
   */
  public abstract static class V201008 {
    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.AdGroupServiceInterface}.
     */
    public static final AdWordsService ADGROUP_SERVICE =
        new AdWordsService("AdGroupService", new AdWordsVersionV201008("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.CampaignAdExtensionServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_AD_EXTENSION_SERVICE =
        new AdWordsService("CampaignAdExtensionService", new AdWordsVersionV201008("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.AdExtensionOverrideServiceInterface}.
     */
    public static final AdWordsService AD_EXTENSION_OVERRIDE_SERVICE =
        new AdWordsService("AdExtensionOverrideService", new AdWordsVersionV201008("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.CampaignTargetServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_TARGET_SERVICE =
        new AdWordsService("CampaignTargetService", new AdWordsVersionV201008("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.CampaignServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_SERVICE =
        new AdWordsService("CampaignService", new AdWordsVersionV201008("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.AdGroupCriterionServiceInterface}.
     */
    public static final AdWordsService ADGROUP_CRITERION_SERVICE =
        new AdWordsService("AdGroupCriterionService", new AdWordsVersionV201008("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.CampaignCriterionServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_CRITERION_SERVICE =
        new AdWordsService("CampaignCriterionService", new AdWordsVersionV201008("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.GeoLocationServiceInterface}.
     */
    public static final AdWordsService GEO_LOCATION_SERVICE =
        new AdWordsService("GeoLocationService", new AdWordsVersionV201008("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.AdGroupAdServiceInterface}.
     */
    public static final AdWordsService ADGROUP_AD_SERVICE =
        new AdWordsService("AdGroupAdService", new AdWordsVersionV201008("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.AdParamServiceInterface}.
     */
    public static final AdWordsService AD_PARAM_SERVICE =
        new AdWordsService("AdParamService", new AdWordsVersionV201008("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.ReportDefinitionService}.
     */
    public static final AdWordsService REPORT_DEFINITION_SERVICE =
        new AdWordsService("ReportDefinitionService", new AdWordsVersionV201008("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.MediaService}.
     */
    public static final AdWordsService MEDIA_SERVICE =
        new AdWordsService("MediaService", new AdWordsVersionV201008("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.BidLandscapeService}.
     */
    public static final AdWordsService BID_LANDSCAPE_SERVICE =
        new AdWordsService("BidLandscapeService", new AdWordsVersionV201008("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.ExperimentService}.
     */
    public static final AdWordsService EXPERIMENT_SERVICE =
        new AdWordsService("ExperimentService", new AdWordsVersionV201008("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.UserListService}.
     */
    public static final AdWordsService USER_LIST_SERVICE =
        new AdWordsService("UserListService", new AdWordsVersionV201008("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.info.InfoServiceInterface}.
     */
    public static final AdWordsService INFO_SERVICE =
        new AdWordsService("InfoService", new AdWordsVersionV201008("info"), "info");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.cm.BulkMutateJobServiceInterface}.
     */
    public static final AdWordsService BULK_MUTATE_JOB_SERVICE =
        new AdWordsService("BulkMutateJobService", new AdWordsVersionV201008("cm"), "cm", "job");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.o.TargetingIdeaServiceInterface}.
     */
    public static final AdWordsService TARGETING_IDEA_SERVICE =
        new AdWordsService("TargetingIdeaService", new AdWordsVersionV201008("o"), "o");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.o.TrafficEstimatorService}.
     */
    public static final AdWordsService TRAFFIC_ESTIMATOR_SERVICE =
        new AdWordsService("TrafficEstimatorService", new AdWordsVersionV201008("o"), "o");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.ch.CustomerSyncService}.
     */
    public static final AdWordsService CUSTOMER_SYNC_SERVICE =
        new AdWordsService("CustomerSyncService", new AdWordsVersionV201008("ch"), "ch");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.mcm.ServicedAccountService}.
     */
    public static final AdWordsService SERVICED_ACCOUNT_SERVICE =
        new AdWordsService("ServicedAccountService", new AdWordsVersionV201008("mcm"), "mcm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201008.mcm.AlertService}.
     */
    public static final AdWordsService ALERT_SERVICE =
        new AdWordsService("AlertService", new AdWordsVersionV201008("mcm"), "mcm");
  }

  /**
   * The service class for v201101. Each {@code AdWordsService} variable
   * indicates which interface should be used.
   */
  public abstract static class V201101 {
    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.AdGroupServiceInterface}.
     */
    public static final AdWordsService ADGROUP_SERVICE =
        new AdWordsService("AdGroupService", new AdWordsVersionV201101("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.CampaignAdExtensionServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_AD_EXTENSION_SERVICE =
        new AdWordsService("CampaignAdExtensionService", new AdWordsVersionV201101("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.AdExtensionOverrideServiceInterface}.
     */
    public static final AdWordsService AD_EXTENSION_OVERRIDE_SERVICE =
        new AdWordsService("AdExtensionOverrideService", new AdWordsVersionV201101("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.CampaignTargetServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_TARGET_SERVICE =
        new AdWordsService("CampaignTargetService", new AdWordsVersionV201101("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.CampaignServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_SERVICE =
        new AdWordsService("CampaignService", new AdWordsVersionV201101("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.AdGroupCriterionServiceInterface}.
     */
    public static final AdWordsService ADGROUP_CRITERION_SERVICE =
        new AdWordsService("AdGroupCriterionService", new AdWordsVersionV201101("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.CampaignCriterionServiceInterface}.
     */
    public static final AdWordsService CAMPAIGN_CRITERION_SERVICE =
        new AdWordsService("CampaignCriterionService", new AdWordsVersionV201101("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.GeoLocationServiceInterface}.
     */
    public static final AdWordsService GEO_LOCATION_SERVICE =
        new AdWordsService("GeoLocationService", new AdWordsVersionV201101("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.AdGroupAdServiceInterface}.
     */
    public static final AdWordsService ADGROUP_AD_SERVICE =
        new AdWordsService("AdGroupAdService", new AdWordsVersionV201101("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.AdParamServiceInterface}.
     */
    public static final AdWordsService AD_PARAM_SERVICE =
        new AdWordsService("AdParamService", new AdWordsVersionV201101("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.ReportDefinitionService}.
     */
    public static final AdWordsService REPORT_DEFINITION_SERVICE =
        new AdWordsService("ReportDefinitionService", new AdWordsVersionV201101("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.MediaService}.
     */
    public static final AdWordsService MEDIA_SERVICE =
        new AdWordsService("MediaService", new AdWordsVersionV201101("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.DataService}.
     */
    public static final AdWordsService DATA_SERVICE =
        new AdWordsService("DataService", new AdWordsVersionV201101("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.ExperimentService}.
     */
    public static final AdWordsService EXPERIMENT_SERVICE =
        new AdWordsService("ExperimentService", new AdWordsVersionV201101("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.UserListService}.
     */
    public static final AdWordsService USER_LIST_SERVICE =
        new AdWordsService("UserListService", new AdWordsVersionV201101("cm"), "cm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.info.InfoServiceInterface}.
     */
    public static final AdWordsService INFO_SERVICE =
        new AdWordsService("InfoService", new AdWordsVersionV201101("info"), "info");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.BulkMutateJobServiceInterface}.
     */
    public static final AdWordsService BULK_MUTATE_JOB_SERVICE =
        new AdWordsService("BulkMutateJobService", new AdWordsVersionV201101("cm"), "cm", "job");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.o.TargetingIdeaServiceInterface}.
     */
    public static final AdWordsService TARGETING_IDEA_SERVICE =
        new AdWordsService("TargetingIdeaService", new AdWordsVersionV201101("o"), "o");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.o.TrafficEstimatorService}.
     */
    public static final AdWordsService TRAFFIC_ESTIMATOR_SERVICE =
        new AdWordsService("TrafficEstimatorService", new AdWordsVersionV201101("o"), "o");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.ch.CustomerSyncService}.
     */
    public static final AdWordsService CUSTOMER_SYNC_SERVICE =
        new AdWordsService("CustomerSyncService", new AdWordsVersionV201101("ch"), "ch");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.mcm.ServicedAccountService}.
     */
    public static final AdWordsService SERVICED_ACCOUNT_SERVICE =
        new AdWordsService("ServicedAccountService", new AdWordsVersionV201101("mcm"), "mcm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.mcm.AlertService}.
     */
    public static final AdWordsService ALERT_SERVICE =
        new AdWordsService("AlertService", new AdWordsVersionV201101("mcm"), "mcm");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.o.BulkOpportunityService}
     */
    public static final AdWordsService BULK_OPPORTUNITY_SERVICE =
        new AdWordsService("BulkOpportunityService", new AdWordsVersionV201101("o"), "o");

    /**
     * Uses the interface
     * {@link com.google.api.adwords.v201101.cm.ConversionTrackerService}
     */
    public static final AdWordsService CONVERSION_TRACKER_SERVICE =
        new AdWordsService("ConversionTrackerService", new AdWordsVersionV201101("cm"), "cm");
  }
}
